package cn.homework.day07;

import java.util.Random;
import java.util.TreeSet;

public class Demo1 {
    public static void main(String[] args) {
        Random r = new Random();
        TreeSet<Integer> ts = new TreeSet<>();
        int index = 1;
        while (ts.size() <= 7) {
            int i = r.nextInt(11) + 10;
            ts.add(i);
            System.out.println("第" + index + "次生成的随机数是：" + i);
            index++;
        }
        System.out.println(ts.size());
        System.out.println(ts);
    }
}
